import { api } from '@/utils/api'
import { stringify } from 'qs'

export default {
  login(params) {
    return api({
      url: '/login',
      method: 'post',
      params
    })
  },
  register(params) {
    return api({
      url: '/register',
      method: 'post',
      params
    })
  },
  refreshToken(params) {
    return api({
      url: '/refreshToken',
      method: 'post',
      params
    })
  },
  // 获取用户列表
  getUserList(params) {
    return api({
      url: `/userList?${stringify(params)}`,
      method: 'get'
    })
  },
  // 删除用户
  deleteUser(id) {
    return api({
      url: `/user/delete?id=${id}`,
      method: 'delete'
    })
  }
}
